package JSE_03.Demo02;

public class Demo02Throw {
    public static void main(String[] args){
        int[] arr=new int[3];
        int e=getElement(arr,3);
        System.out.println(e);
    }

    public static int getElement(int[] arr,int index){
        if(arr==null){
            throw new NullPointerException("传递的数组值是null");
        }

        int ele=arr[index];
        return ele;
    }
}
